﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace SwanEngine.Astar
{
    /************************************************************************/
    /* 用于A*寻路的内部数据结构                                                                     */
    /************************************************************************/
	public class Node
	{

        public int x;
        public int y;
        public Vector2 pt;

        public float f; // f = g+ h
        public float g; //从起点到当前格子的消耗
        public float h; //当前格子到终点的消耗

        public bool walkable = true;

        public Node parent;

        public int version = 1;

        public List<Node> links = new List<Node>();

        public bool initLink = false;

        public Node(int x, int y)
        {
            this.x = x;
            this.y = y;
            this.pt = new Vector2(x, y);
        }

	}
}
